'use strict';

module.exports = app => {
    const { STRING, UUID, UUIDV4, INTEGER, DECIMAL, DATE } = app.Sequelize;

    const model = app.model.define('project_product', {
        id: {
            type: UUID,
            defaultValue: UUIDV4,
            primaryKey: true,
            comment: 'Id',
        },
        proj_id: {
            type: UUID,
            allowNull: false,
            comment: '项目名称',
        },
        product_id: {
            type: STRING,
            comment: '项目代码',
        },
        product_name: {
            type: DATE,
            comment: '预计成交时间',
        },
        num: {
            type: UUID,
            comment: '业务员Id',
        },
        sale_price: {
            type: DECIMAL,
            comment: '销售价格'
        },
        amount: {
            type: DECIMAL,
            comment: '销售货值'
        },
    }, {
            tableName: 'project_product',
            comment: '项目产品表',
        });

    return model;
};
